//created by JIAN HUA
Ext.define("MajorProjectSenchaTouch.view.NewArrivals.NewArrivalsSort",{
    extend: 'Ext.Panel',
    xtype: 'typesort',
	id: 'Sorttype',
    requires: [
    'Ext.Label'
    ],
    config:{
          
        layout: [{
            type: 'hbox'
        }],
		loop: true,
        items:[
        {
            xtype: 'panel',
            id: 'NewresultSortWrapper2',
            items:[
          
            {
                xtype: 'label',
                id: 'kresultsummaryBtn'
            },
            {
                xtype: 'selectfield',
                id: 'newsorterField',
                ui: 'light',
                usePicker: true,
			
               
                field: 'Filter',
               
              
               options: [
					{
						text: 'Sort by: Year',
						value: 'Year'
					},
					{
						text: 'Sort by: Author',
						value: 'Author'
					},
					{
						text: 'Sort by: Title',
						value: 'Title'
					},
					{
						text: 'Sort by: Format',
						value: 'Format'
					},
					{
						text: 'Sort by: Call Number',
						value: 'Callnum'
					}
                ],
/*
|--------------------------------------------------------------------------
| (@author : JIAN HUA)
|--------------------------------------------------------------------------
|
| When the picker value change it will call goSortResult in NewArrivals
| Controller to sort the results. 
|
// */
                
                listeners:{
                    change: function(select, newValue, oldValue){
                        var searchController = MajorProjectSenchaTouch.app.getController('NewArrivals');
                        searchController.goSortResult();
						}
                    }
                }
            
			      ]
        }]
    }
});